#director设置 nat 防火墙
iptables -t nat -F

#!/bin/bash
VIP=192.168.152.130
DIP=192.168.152.128

RIP1=192.168.152.129
RIP2=192.168.152.133

# director服务器上开启路由转发功能:
echo 1 > /proc/sys/net/ipv4/ip_forward
# 关闭 icmp 的重定向
echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/default/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/ens33/send_redirects
echo 0 > /proc/sys/net/ipv4/conf/ens36/send_redirects
# director设置 ipvsadm
IPVSADM='/sbin/ipvsadm'
$IPVSADM -C
$IPVSADM -A -t $VIP:80 -s rr
$IPVSADM -a -t $VIP:80 -r $RIP1:80 -m
$IPVSADM -a -t $VIP:80 -r $RIP2:80 -m

echo "start director-nat"
